import React from 'react';
import {Col, Icon, Row} from 'antd';
import BaseComponent from "../Base/BaseComponent";
import styles from "../../pages/Home/System/ModelTool/index.module.css";

class RectTip extends BaseComponent {
    constructor(props) {
        super(props);

        this.state = {
            tip: props.tip || '',
            noBorder: props.noBorder || false,
        }
    }

    componentWillReceiveProps(nextProps) {
        this.setState({tip: nextProps.tip, noBorder: nextProps.noBorder})
    }


    render() {
        return (
            <Row>
                <Col xs={24} sm={24} md={24} className={styles.tableAlert}>
                    <div className={!this.props.noBorder ? styles.tableAlertDiv : ''}>
                        <span>
                            <Icon type="info-circle" style={{marginRight: '10px'}}/>
                            <a className={styles.clearLink}
                               style={{fontWeight: 600}}>
                                {this.state.tip}
                            </a>
                        </span>
                    </div>
                </Col>
            </Row>
        )
    }
}

export default RectTip;
